package com.zjut.an.util.module;

import java.util.List;

public class PageModule {
	
	private int total;
	private int page;
	private int pagesize;
	private int totalpage;
	private List<Object> objects;
	
	public PageModule(int page, int pagesize, int total, List<Object> objects) {
		this.page = page;
		this.pagesize = pagesize;
		this.total = total;
		this.objects = objects;
		if (pagesize==0)pagesize=1;
		this.totalpage = total % pagesize != 0?total/pagesize + 1:total/pagesize;
		//System.out.println("########### " + page + "# " + pagesize  + "# " + total  + "# " + objects);
	}
	
	public int getTotal() {
		return total;
	}

	public void setTotal(int total) {
		this.total = total;
	}

	public int getPage() {
		return page;
	}

	public void setPage(int page) {
		this.page = page;
	}

	public int getPagesize() {
		return pagesize;
	}

	public void setPagesize(int pagesize) {
		this.pagesize = pagesize;
	}

	public int getTotalpage() {
		return totalpage;
	}

	public void setTotalpage(int totalpage) {
		this.totalpage = totalpage;
	}

	public List<Object> getObjects() {
		return objects;
	}

	public void setObjects(List<Object> objects) {
		this.objects = objects;
	}
	
}
